#!/bin/sh
# -*- tab-width:4;indent-tabs-mode:nil -*-
# ex: ts=4 sw=4 et

# Pull environment for this install
. "{{runner_base_dir}}/lib/env.sh"

# Make sure the user running this script is the owner and/or su to that user
check_user $@
ES=$?
if [ "$ES" -ne 0 ]; then
    exit $ES
fi

# Keep track of where script was invoked
ORIGINAL_DIR=$(pwd)

# Make sure CWD is set to runner run dir
cd $RUNNER_BASE_DIR

# Identify the script name
SCRIPT=`basename $0`

# Make sure the local node IS running
node_up_check
$NODETOOL rpc_infinity riak_search_cmd command $ORIGINAL_DIR "$@"
